package com.iwhalecloud.citybrain.flow.platform.manager.application.common.enums;

import com.iwhalecloud.citybrain.flow.platform.manager.application.common.properties.UserEnumProperties;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author cheng.huaxing
 * @date 2019-02-24
 */
public enum UserEnum {
    /**
     * 普通用户
     */
    NORMAL("NORMAL"),

    /**
     * 租户
     */
    TENANT("TENANT"),

    /**
     * 超级管理员
     */
    SUPER("SUPER");

    private static Map<String, UserEnum> typeToEnum;


    UserEnum(String type) {
        this.type = type;
    }

    private String type;

    public String type() {
        return this.type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public static UserEnum getUser(String type) {
        return typeToEnum.get(type);
    }

    public static void setTypeToEnum(Map<String, UserEnum> typeToEnum) {
        UserEnum.typeToEnum = typeToEnum;
    }
}
